<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.global.js'></script>
</head>

<body>
    <div id='app'>
        <custom-layout id="custom-layout" @click="onClick"></custom-layout>
    </div>

    <script>
        const app = Vue.createApp({
            methods:{
                onClick(){
                    alert("fuck off")
                }
            }
        })
        // 没有警告，$attrs 被传递到 <main> 元素
        app.component('custom-layout', {
            template: `
            <header>我的头</header>
            <main v-bind="$attrs">伦家的身子</main>
            <footer>我的脚</footer>
            `
        })
        app.mount('#app')
    </script>
</body>

</html>